<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>我的订阅  - 会员中心 -{$sitename}</title>
{include file="center_include"/}
<script type="text/javascript">
		function setupLabel(){
            if($('.label-checkbox input').length) {
                $('.label-checkbox').each(function(){
                    $(this).removeClass('label-checkbox-on');
                });
                $('.label-checkbox input:checked').each(function(){
                    $(this).parent('label').addClass('label-checkbox-on');
                });
            };
            if($('.label-radio input').length) {
                $('.label-radio').each(function(){
                    $(this).removeClass('label-radio-on');
                });
                $('.label-radio input:checked').each(function(){
                    $(this).parent('label').addClass('label-radio-on');
                });
            };
        }
		function initLabelEvent(){
			$(".user-img-list li").hover(function(){
				$(this).find(".ui-del").show();
			},function(){
				$(this).find(".ui-del").hide();
			});
			$('.label-checkbox').click(function(){
				setupLabel();
			});
			setupLabel();
		}  
	</script>
</head>
<body>
{include file="center_header"/}
<div id="content" class="layout">
  <div class="ui-box ui-qire fn-clear" id="i-box">
    <div id="i-bar">
 {include file="center_nav"/} 
 {include file="center_fk"/}
      <!-- // user-nav end -->
    </div>
    <!-- // i-bar end -->
   <div class="i-box-cnt" id="i-cnt">
      <div id="i-subscribe">
        <div class="ui-title i-tab-nav-box fn-clear">
          <ul class="i-tab-nav" id="pids">
            <li class="current"><a href="{:zanpian_user_url('user/center/remind',array('op'=>1))} " hidefocus="">全部</a></li>
              {volist name="catalogs" id="catalog"}
            	<li class="line"></li>
            	<li><a href="{:zanpian_user_url('user/center/remind',array('op'=>1,'pid'=>$catalog['list_id'],'p'=>1))}" hidefocus="">{$catalog.list_name}<span>{$catalog.count}</span></a></li>
              {/volist}
          </ul>
          <a class="i-button i-button-rsset" href="{:zanpian_user_url('user/center/email')}">订阅更新设置</a></div>
        <div class="ui-cnt">
          <ol class="user-img-list" id="i-rss-list">
              <li class="loading"><img src="{$apicss}user/new/images/loading.gif"/>正在努力为您加载中...
          </ol>
          <div class="user-opera fn-clear" style="margin: 15px 0px 20px; border-top-width: 1px; border-top-style: solid; border-top-color: rgb(245, 245, 245);" id="i-do">
            <div class="check-del">
              <label class="label-checkbox" for="checkall" hidefocus=""><input type="checkbox" id="checkall">全选</label>
              <form action="" method="post" id="delremindform">
                <input type="hidden" value="" id="ids" name="ids">
                <a class="ui-edit ui-edit-short cleanup" href="javascript:;" data="1" id="delchecked">删除</a>
              </form>
            </div>
            <div class="loading pagess"><ul class="pagination" id="xpage" style="float:right"></ul></div>
          </div>
        </div>
      </div>
      <!-- // ui-box End -->
      <div id="i-hot-rss">
        <div class="ui-title i-tab-nav-box">
          <ul class="i-tab-nav">
            <li class="current">热门订阅</li>
          </ul>
        </div>
        <div class="ui-cnt">
          <ol class="user-img-list" id="hotremind">
           <li class="loading"><img src="{$apicss}user/new/images/loading.gif"/>正在努力为您加载中...</li>
          </ol>
          <!-- // pic-list End -->
        </div>
      </div>
      <!-- // ui-box End -->
    </div>
    <!-- // i-cnt End -->
   <script type="text/javascript">
		function pagegoo(url){
			$.ajax({ 
				url: url,  
				success: function(data){
					if(data.ajaxtxt!=''){
						$("#i-rss-list").html(data.ajaxtxt);
						initLabelEvent();
						$("#i-do").show();
						$("#checkall").click(function(e){
							if ($(this).is(":checked")) {
								$("#i-rss-list [name = ids[]]:checkbox").each(function () {
										$(this).attr('checked',true);
								});							 
							}else{
								$("#i-rss-list [name = ids[]]:checkbox").each(function () {
											$(this).attr('checked',false);
								});		
							}
						});
					}else{ 
						$("#i-rss-list").html('<li class="kong">当前没有订阅，您可以点击下面的订阅</li>');
						$("#i-do").hide();
					}
					$("#xpage").html(data.pages);
					$("#xpage a").click(function(e){
						pagegoo(e.target);
						return false;
					});
					$(".fav-cancel").click(function(event){
						var parents=$(this).parents('li');
						$.showfloatdiv({
							wantclose:2,
							succdo:function(r){
								if(parseInt(r.rcode)==1){
									//pagegoo(window.location.href+"-ajax");	
									pagegoo("{:zanpian_user_url('user/center/remind',array('op'=>1))}");	
									gethot("{:zanpian_user_url('user/center/getremind')}");
									$("#pids").html(r.dhtxt);
									$("#pids a").unbind();
									$("#pids a").click(
									function (e){
										$(this).parent('li').nextAll().removeClass('current');
										$(this).parent('li').prevAll().removeClass('current');
										$(this).parent('li').addClass('current');
										pagegoo($(this).attr('href'));
										return false;
									}
									);
								}
							},txt:'确认删除?'
						});
					});
					$(".i-rss-list").hover(function(){
						var vid=$(this).find(".play-pic").attr('data');
						if($("#play"+vid).attr('data')==''){
							url="{:zp_url('user/center/getplayurl','',false,false)}-id-"+vid;
							$.ajax({
								url:url,
								success: function(r){
									$("#play"+vid).html(r);
									$("#play"+vid).attr('data','1');
								},
								dataType: 'html'
							});
						}
						$(this).find(".i-rss-box").show();
					},function(){
						$(this).find(".i-rss-box").hide();
					});
				},
				dataType:'json'
			});
			return false;				
		}
		pagegoo(window.location.href);	
		$("#pids a").click(
			function(e){
				$(this).parent('li').nextAll().removeClass('current');
				$(this).parent('li').prevAll().removeClass('current');
				$(this).parent('li').addClass('current');
				pagegoo($(this).attr('href'));
				return false;
			}
		);
		$(".boxpic").mouseover(
			function(){
				if($("#play"+$(this).attr('data')).attr('data')==''){
					var vid=$(this).attr('data');
					url="{:zanpian_user_url('user/center/getplayurl','',false,false)}-id-"+vid;
					$.ajax({
						url:url,
						success: function(r){
							$("#play"+vid).html(r);
							$("#play"+vid).attr('data','1');
						},
						dataType: 'html'
					});
				}
			}
		);
		pagegoo("{:zanpian_user_url('user/center/remind',array('op'=>1))}");
		function gethot(url){
			$.ajax({ 
				url: url,  
				success: function(data){
					$("#hotremind").html(data);
					$('.fav-add').unbind();
					$('.fav-add').click(function (e){
						$.showfloatdiv({cssname:'loading'});
			    		var turl=$(this).attr('href');
						  $.get(
							turl,'',
							function(data){
								$.hidediv(data);
								if(parseInt(data.rcode)>0){
									gethot("{:zanpian_user_url('user/center/getremind')}");
									pagegoo("{:zanpian_user_url('user/center/remind',array('op'=>1))}");
									$("#pids").html(data.dhtxt);
									$("#pids a").click(
										function (e){
											$(this).parent('li').nextAll().removeClass('current');
											$(this).parent('li').prevAll().removeClass('current');
											$(this).parent('li').addClass('current');
											pagegoo($(this).attr('href'));
											return false;
										}
									);
								}
							},
							'json'
						); 
						return false;
					});
			},dataType:'json'});
		}
		gethot("{:zanpian_user_url('user/center/getremind')}");
		function delcheck(){
			$("#delchecked").unbind();
			$("#delchecked").click(
				function(e){
					var result = new Array();
					$("#i-rss-list [name = ids[]]:checkbox").each(function () {
						if ($(this).is(":checked")) {
							result.push($(this).attr("value"));
						}
					});		
					$.showfloatdiv({
							txt:'确定删除？',
							wantclose:2,
							suredo:function(e){
							$("#ids").attr('value',result);
							$("#delremindform").qiresub({
								curobj:$("#delchecked"),
								txt:'数据提交中,请稍后...',
								onsucc:function(result){
									$.hidediv(result);
									if(parseInt(result['rcode'])>0){
											pagegoo("{:zanpian_user_url('user/center/remind',array('op'=>1))}");	
											gethot("{:zanpian_user_url('user/center/getremind')}");
											$("#pids").html(result.dhtxt);
											$("#pids a").unbind();
											$("#pids a").click(
											function (e){
												$(this).parent('li').nextAll().removeClass('current');
												$(this).parent('li').prevAll().removeClass('current');
												$(this).parent('li').addClass('current');
												pagegoo($(this).attr('href'));
												return false;
											}
											);
											$("#checkall").attr('checked',false);
											}
								}
							}).post({
								url:"{:zanpian_user_url('user/center/delremind')}"
								});
							$.closefloatdiv();
							return false;
							}
					});
				}
			);
		}
		delcheck();
		</script>
  </div>
  <!-- // maxBox End -->
</div>
<!-- // wrap End -->
</div>
<!-- // footer end -->
{include file="footer"/}
</body>
</html>